import request from "@/axios/axiosss";


export function login(params){
    params.grant_type = 'password'
    return request({
        method: 'post',
        url: '/oauth/token',
        headers:{
            isToken:false,
            ContentType: "application/x-www-form-urlencoded",
            Authorization : "Basic aHdiX3NpdGU6MTIzNDU="
        },
        params: params
    })
}

export function login_refresh(params){
    params.grant_type = 'refresh_token'
    return request({
        method: 'post',
        url: '/oauth/token',
        headers:{
            isToken:false,
            ContentType: "application/x-www-form-urlencoded",
            Authorization : "Basic aHdiX3NpdGU6MTIzNDU="
        },
        params: params
    })
}


export function get_user(){
    return request({
        method: 'post',
        url: '/tt/user/userId',
    })
}

export function register(params){
    return request({
        method: 'post',
        url: '/tt/user/register',
        headers:{
            isToken:false
        },
        data: params
    })
}

export function edit_user(params){
    return request({
        method: 'post',
        url: '/tt/user/edit',
        data: params
    })
}
